var MyQueue = function () {
    this.stack = [];
    this._stack = [];
};

/** 
 * @param {number} x
 * @return {void}
 */
MyQueue.prototype.push = function (x) {
    while (this._stack.length) {
        this.stack.push(this._stack.pop());
    }
    this.stack.push(x);
};

/**
 * @return {number}
 */
MyQueue.prototype.pop = function () {
    while (this.stack.length) {
        this._stack.push(this.stack.pop());
    }
    return this._stack.pop();
};

/**
 * @return {number}
 */
MyQueue.prototype.peek = function () {
    while (this._stack.length) {
        this.stack.push(this._stack.pop());
    }
    return this.stack[0];
};

/**
 * @return {boolean}
 */
MyQueue.prototype.empty = function () {
    return this.stack.length === 0 && this._stack.length === 0;
};

/**
 * Your MyQueue object will be instantiated and called as such:
 * var obj = new MyQueue()
 * obj.push(x)
 * var param_2 = obj.pop()
 * var param_3 = obj.peek()
 * var param_4 = obj.empty()
 */